package com.cosina.game.tank.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.SurfaceHolder.Callback;

import com.cosina.game.tank.model.War;
import com.cosina.game.tank.model.impl.NormalWar;

public class WarView extends SurfaceView{

	public War war;

	public WarView(Context context,AttributeSet set) {
		super(context,set);
		this.getHolder().addCallback(new Callback(){
			@Override
			public void surfaceChanged(SurfaceHolder holder, int format,
					int width, int height) {
				
			}

			@Override
			public void surfaceCreated(SurfaceHolder holder) {
				war = new NormalWar(WarView.this,holder);
				war.start();
				
			}

			@Override
			public void surfaceDestroyed(SurfaceHolder holder) {
				war.run = false;
			}});
	}
}
